﻿using System;

namespace Runtime.Models {

    /// <summary>
    /// 战斗数据
    /// </summary>
    public interface IDFR_BattleModelsBase {

        /// <summary>
        /// 时间缩放
        /// </summary>
        IReadOnlyFloatData TimeScale { get; }

        /// <summary>
        /// 单元格数据集
        /// </summary>
        IDFR_ReadOnlyBattleCellDictionaryModelBase CellDictionary { get; }

        /// <summary>
        /// 进攻方数据集
        /// </summary>
        IDFR_ReadOnlyBattleAttackSourceDictionaryModelBase AttackSourceDictionary { get; }

        /// <summary>
        /// 敌方数据集
        /// </summary>
        IDFR_ReadOnlyBattleAttackTargetDictionaryModelBase AttackTargetDictionary { get; }

        /// <summary>
        /// 是否各处CD可运行
        /// </summary>
        bool IsCoolDownCanElapse { get; }
    }

    [Implement(typeof(IDFR_BattleModelsBase))]
    public class DFR_BattleModelsBase : DFR_Model, IDFR_BattleModelsBase {

        [Autowired]
        private readonly IDFR_BattleCellDictionaryModelBase m_CellDictionary;
        public IDFR_ReadOnlyBattleCellDictionaryModelBase CellDictionary => m_CellDictionary;

        [Autowired]
        private readonly IDFR_BattleAttackSourceDictionaryModelBase m_AttackSourceDictionary;
        public IDFR_ReadOnlyBattleAttackSourceDictionaryModelBase AttackSourceDictionary => m_AttackSourceDictionary;

        [Autowired]
        private readonly IDFR_BattleAttackTargetDictionaryModelBase m_AttackTargetDictionary;
        public IDFR_ReadOnlyBattleAttackTargetDictionaryModelBase AttackTargetDictionary => m_AttackTargetDictionary;

        [Autowired]
        private readonly IFloatData m_TimeScale;
        public IReadOnlyFloatData TimeScale => m_TimeScale;

        public virtual bool IsCoolDownCanElapse { get; } = true;
    }
}
